﻿using Architecture.Domain.Service;
using Architeture.Domain;
using MediatR;
using RBAC.ZhuBoLin.Application.Command.RoleCommand;
using System.Net;

namespace RBAC.ZhuBoLin.Application.CommandHandlers.RoleHandler
{
    public class UserUpdateCommandHandler : IRequestHandler<UserUpdateCommand, int>
    {
        private readonly IUserService _userService;

        public UserUpdateCommandHandler(IUserService userService)
        {
            _userService = userService;
        }

        public async Task<int> Handle(UserUpdateCommand request, CancellationToken cancellationToken)
        {
            return await _userService.UserUp(new UserInfo() { UserInfoid = request.UserInfoid, UserName = request.UserName, UserPwd = request.UserPwd, IsSex = request.IsSex, ProvinceInfoId = request.ProvinceInfoId, CityInfoId = request.CityInfoId, countyId = request.countyId, Address = request.Address, AddName = request.AddName, AddTime = request.AddTime, UpdName = request.UpdName, UpdTime = request.UpdTime, IsDel = request.IsDel, department = request.department });
        }
    }
}
